//
//  LLTransparentNavView.m
//  LoveLove
//
//  Created by 肖兰月 on 2019/4/6.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLTransparentNavView.h"

@interface LLTransparentNavView ()
@property (strong, nonatomic) LLButton *leftItem;
@property (strong, nonatomic) LLButton *rightItem;
@end

@implementation LLTransparentNavView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews {
    _leftItem = [LLInitBaseViewTool buttonWithTitle:nil image:nil titleColor:nil font:0];
    _leftItem.tag = 0;
    _leftItem.frame = CGRectMake(0, self.height-44, 44, 44);
    [_leftItem addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_leftItem];
    
    _rightItem = [LLInitBaseViewTool buttonWithTitle:nil image:nil titleColor:nil font:0];
    _rightItem.tag = 1;
    _rightItem.frame = CGRectMake(self.width-44, self.height-44, 44, 44);
    [_rightItem addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:_rightItem];
}

- (void)setLeftItemImg:(NSString *)leftItemImg {
    _leftItemImg = leftItemImg;
    [_leftItem setImage:[UIImage imageNamed:leftItemImg] forState:0];
}

- (void)setRightItemImg:(NSString *)rightItemImg {
    _rightItemImg = rightItemImg;
    [_rightItem setImage:[UIImage imageNamed:rightItemImg] forState:0];
}

- (void)itemClick:(LLButton *)item {
    if ([self.delegate respondsToSelector:@selector(transparentNavViewDidClickItemWithIndex:)]) {
        [self.delegate transparentNavViewDidClickItemWithIndex:item.tag];
    }
}


@end
